package b3.widget.guild
{
	import b3.config.*;
	import b3.model.*;
	import b3.net.*;
	import b3.scene.home.*;
	import b3.util.*;
	import b3.widget.basic.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.filters.*;
	import flash.text.*;
	
	public class GuildInfoItem extends Sprite
	{
		public function GuildInfoItem( guild:Guild)
		{
			super();
			//背景框
			var SocialItemBgr:Class = ResourceHelper.getInstance().getClassByName("MatchItemBgr");
			addChild(new SocialItemBgr());
			var name:String = "<font color='#0000FF'> "+ guild.name +"     <i><font color='#FF0000'><A href=\"event:" + guild.userId + "\">" +  "  加入公会  " + "</A></font></i> </font>";
			
			var textField:TextField = new TextField();
			textField.selectable = false;
        	textField.autoSize = TextFieldAutoSize.LEFT;
			textField.defaultTextFormat = new TextFormat("微软雅黑", 14, 0x000000, true);
			textField.filters = [new GlowFilter(0xFFFFFF, 1, 1.3, 1.3, 100, BitmapFilterQuality.HIGH)];
			textField.x = 20;
			textField.y = 5;
			
			textField.htmlText = name ;
			
			textField.addEventListener(TextEvent.LINK, onTextLink);
			addChild(textField);
		}
		
		private function onTextLink(event:TextEvent):void
		{//加入公会的跳转
			var idString:String = event.text;
			var guildId:int = parseInt(idString);
			GuildManager.getInstance().sendJoinRequest(guildId);
		}

	}
}